﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DesignPatternsDemo.Builder
{
    public class Product
    {
        /**
         * product builder
         */
        public class Builder
        {
            private string _name;
            private string _description = "";
            private string _manufacturer = "";

            public Builder(string name)
            {
                _name = name;
            }

            public Builder SetDescription(string description)
            {
                _description = description;
                return this;
            }

            public Builder SetManufacturer(string manufacturer)
            {
                _manufacturer = manufacturer;
                return this;
            }

            public Product Build()
            {
                Product product  = new Product();
                product._name = this._name;
                product._description = this._description;
                product._manufacturer = this._manufacturer;
                return product;
            }
        }

        private string _name;
        private string _description;
        private string _manufacturer;

        public string Name { get { return _name; } }
        public string Description { get { return _description; } }
        public string Manufacturer { get { return _manufacturer; } }
    }
}
